package com.example.s06blog.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.s06blog.mapper.UserMapper;
import com.example.s06blog.pojo.User;
import com.example.s06blog.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @auther Qiang
 * @date 2022/4/1 16:51
 */

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService
{
    @Autowired
    private UserMapper userMapper;

    @Override
    public User login(String username, String password)
    {
        System.out.println(username+","+password);
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username",username);
        queryWrapper.eq("password",password);

        return userMapper.selectOne(queryWrapper);
    }
}
